package com.tanhua.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.model.domain.Analysis;
import org.apache.ibatis.annotations.Select;

import java.util.Date;


public interface AnalysisMapper extends BaseMapper<Analysis> {

    @Select("SELECT SUM(num_active) FROM tb_analysis WHERE record_date > #{date}")
    Integer activePass(Date date);

    @Select("SELECT num_registered FROM tb_analysis WHERE record_date = #{date}")
    Integer newUsers(Date date);

    @Select("SELECT num_login FROM tb_analysis WHERE record_date = #{date}")
    Integer loginTimes(Date date);

    @Select("SELECT num_active FROM tb_analysis WHERE record_date = #{date}")
    Integer activeUsers(Date date);
}
